package com.sefonsoft.dataanalysis.service.model;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;
/**
 * 封装数据对象
 * @author xgj
 *
 */
public class Datas<T> implements Serializable {
	
	
	public Datas() {
		super();
	}

	public Datas(int count, List<T> datas) {
		super();
		this.count = count;
		this.datas = datas;
	}
	
	public Datas(T t) {
		if (this.datas == null) {
			datas = new ArrayList<>();
		}
		this.datas.add(t);
	}
	
	public Datas(List<T> datas) {
		if (this.datas == null) {
			datas = new ArrayList<>();
		}
		this.datas.addAll(datas);
	}
	
	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;

	/**
	 * 个数
	 */
	int count;
	
	/**
	 * 数据
	 */
	List<T> datas = new ArrayList<>();

	public int getCount() {
		return count;
	}

	public void setCount(int count) {
		this.count = count;
	}

	public List<T> getDatas() {
		if (datas == null) {
			datas = new ArrayList<>();
		}
		return datas;
	}

	public void setDatas(List<T> datas) {
		this.datas = datas;
	}
		
}
